# coding=utf-8
import arcpy

path = r'D:\Test';
arcpy.env.workspace = path
shp = r'D:\Test\YA_RIV_LEVEL6_4326_0717_1.shp'.decode('utf-8')
cs1 = arcpy.da.UpdateCursor(shp,['SHAPE@','name','proLen','totalLen','curLen'])

for row1 in cs1:
    totalLen = row1[3]
    curLen = row1[4]
    proLen = '%.2f' % round(row1[0].projectAs(arcpy.SpatialReference(4543)).length / 1000.0,2)
    if(totalLen == curLen):
        row1[3] = proLen
        row1[4] = proLen
    else:
        row1[4] = proLen
    cs1.updateRow(row1)
    print row1[1],row1[3],row1[4],proLen